﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yugi.Client.Card;
namespace Yugi.Client
{
    public partial class SupervisorModel 
    {
        /// <summary>
        /// Bat Dau Main Phase 1
        /// </summary>
        /// <param name="param"></param>
        private void ProcessFromServer_TURN_MAINPHASE1_BEGIN(params object[] param)
        {
            int id = (int)param[0];

            if (id != this.Nguoi_Choi.YPlayer.ID)
            {
                //Khong phai luot Choi cua minh
                this.Turn.ReceiveMessageFromSupervisor(ClientMSG.DoiTurn, EnumTable.MainPhase1);
                return;
            }
            this.TableGame.YStateNow = EnumTable.MainPhase1;
            this.Nguoi_Choi.YStateNow = EnumTable.MainPhase1;
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.ChonBai);
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.ChoPhepDoiCongThu);
            this.Turn.ReceiveMessageFromSupervisor(ClientMSG.DoiTurn, EnumTable.MainPhase1);
        }
        //-------------------------------------------Normal Summon--------------------------------//
        /// <summary>
        /// Len Bai Hop Le( Nhac ku Hau sua cho nay)
        /// </summary>
        /// <param name="param">chua la bai hop le</param>
        private void ProcessFromServer_CARD_LENBAI_HOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiHopLe, param);
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.LenBaiHopLe, param);
        }

        /// <summary>
        /// Len Bai Khong Hop Le
        /// </summary>
        /// <param name="param">Ly Do Khong Hop Le</param>
        private void ProcessFromServer_CARD_LENBAI_KHONGHOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiKhongPhuHop, param);
        }

        /// <summary>
        /// Nguoi Choi COn lai len bai xong => Post la bai len ban choi
        /// </summary>
        /// <param name="param">toa do x, y, Trang Thai cua la bai nguoi choi kia Post(luu y fai Convert toa do truoc)</param>
        private void ProcessFromServer_CARD_LENBAI_XONG(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiDoiThu, param);
        }

        /// <summary>
        /// Nguoi Choi Kia Doi Trang Thai Xong => The Hien Len Ban Choi
        /// </summary>
        /// <param name="param">ID Card Trang Thai Moi</param>
        private void ProcessFromServer_CARD_DOITRANGTHAI_XONG(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.DoiCongThuDoiThu, param);
        }

        /// <summary>
        /// Nguoi Choi Kia Len Bai Dac Biet => The Hien
        /// </summary>
        /// <param name="param"></param>
        private void ProcessFromServer_CARD_LENBAI_SUMMONDACBIET_XONG(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiDacBietDoiThu, param);
        }

        /// <summary>
        /// Len Bai Dac Biet Hop Le
        /// </summary>
        /// <param name="param"></param>
        private void ProcessFromServer_CARD_LENBAI_SUMMONDACBIET_HOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiDacBietHopLe, param);
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.LenBaiDacBietHopLe, param);
        }

        private void ProcessFromServer_CARD_LENBAI_SUMMONDACBIET_KHONGHOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiKhongPhuHop, param);
        }
        //------------------------------SPELL-----------------------------------//
        /// <summary>
        /// Len Bai Hop Le( Nhac ku Hau sua cho nay)
        /// </summary>
        /// <param name="param">chua la bai hop le</param>
        private void ProcessFromServer_CARD_LENBAI_SPELL_HOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiSpellHopLe, param);
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.LenBaiSpellHopLe, param);
        }

        /// <summary>
        /// Len Bai Khong Hop Le
        /// </summary>
        /// <param name="param">Ly Do Khong Hop Le</param>
        private void ProcessFromServer_CARD_LENBAI_SPELL_KHONGHOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiKhongPhuHop, param);
        }

        /// <summary>
        /// Nguoi Choi COn lai len bai xong => Post la bai len ban choi
        /// </summary>
        /// <param name="param">toa do x, y, Trang Thai cua la bai nguoi choi kia Post(luu y fai Convert toa do truoc)</param>
        private void ProcessFromServer_CARD_LENBAI_SPELL_XONG(params object[] param)
        {
            
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiSpellDoiThu, param);
        }

        //------------------------------Trap-----------------------------------//
        /// <summary>
        /// Len Bai Hop Le( Nhac ku Hau sua cho nay)
        /// </summary>
        /// <param name="param">chua la bai hop le</param>
        private void ProcessFromServer_CARD_LENBAI_TRAP_HOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiTrapHopLe, param);
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.LenBaiTrapHopLe, param);
        }

        /// <summary>
        /// Len Bai Khong Hop Le
        /// </summary>
        /// <param name="param">Ly Do Khong Hop Le</param>
        private void ProcessFromServer_CARD_LENBAI_TRAP_KHONGHOPLE(params object[] param)
        {
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiKhongPhuHop, param);
        }

        /// <summary>
        /// Nguoi Choi COn lai len bai xong => Post la bai len ban choi
        /// </summary>
        /// <param name="param">toa do x, y, Trang Thai cua la bai nguoi choi kia Post(luu y fai Convert toa do truoc)</param>
        private void ProcessFromServer_CARD_LENBAI_TRAP_XONG(params object[] param)
        {
            
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.LenBaiTrapDoiThu, param);
        }


        private void ProcessFromServer_TURN_MAINPHASE1_END(params object[] param)
        {
            this.Nguoi_Choi.ReceiveMessageFromSupervisor(ClientMSG.KetThucMF);
            this.TableGame.ReceiveMessageFromSupervisor(ClientMSG.KetThucMF);
        }

        
    }
}
